]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Don't linebreak before closing parentheses
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 3 Apr 2020 23:52:29 +0000 (01:52 +0200)
committerverdre <jonas@dressler.it>
Tue, 28 Apr 2020 09:04:49 +0000 (09:04 +0000)
Otherwise recent versions of eslint want "dangling" commas,
which is at least ugly considering that most functions don't
allow adding arguments at leasure.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1177

19 files changed:
js/misc/jsParse.js
js/ui/altTab.js
js/ui/appDisplay.js
js/ui/audioDeviceSelection.js
js/ui/components/__init__.js
js/ui/components/autorunManager.js
js/ui/extensionSystem.js
js/ui/keyboard.js
js/ui/lightbox.js
js/ui/lookingGlass.js
js/ui/magnifier.js
js/ui/messageTray.js
js/ui/overview.js
js/ui/panel.js
js/ui/search.js
js/ui/shellMountOperation.js
js/ui/status/network.js
js/ui/status/system.js
js/ui/workspacesView.js

index 15a34c975769fdef3c0e4bab542a2a1f8232ca4f..c92465fc206fdd8a7f9bbf80a573b8bafb6b2fb5 100644 (file)
@@ -24,8 +24,7 @@ function getCompletions(text, commandHeader, globalCompletionList) {
             [expr_, base, attrHead] = matches;
 
             methods = getPropertyNamesFromExpression(base, commandHeader).filter(
-                attr => attr.slice(0, attrHead.length) == attrHead
-            );
+                attr => attr.slice(0, attrHead.length) === attrHead);
         }
 
         // Look for the empty expression or partially entered words
@@ -34,8 +33,7 @@ function getCompletions(text, commandHeader, globalCompletionList) {
         if (text == '' || matches) {
             [expr_, attrHead] = matches;
             methods = globalCompletionList.filter(
-                attr => attr.slice(0, attrHead.length) == attrHead
-            );
+                attr => attr.slice(0, attrHead.length) === attrHead);
         }
     }
 
index 1c35a001e913122d984ecc07db46468a283f1956..5cebc1c83860736b44e2201ecc33ecffa086ca33 100644 (file)
@@ -681,8 +681,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
             // Cache the window list now; we don't handle dynamic changes here,
             // and we don't want to be continually retrieving it
             appIcon.cachedWindows = allWindows.filter(
-                w => windowTracker.get_window_app(w) == appIcon.app
-            );
+                w => windowTracker.get_window_app(w) === appIcon.app);
             if (appIcon.cachedWindows.length > 0)
                 this._addIcon(appIcon);
         }
index 8139fe9494c400a86d18ee464b0c3a8b99402230..99a023fa2633124845f172cf85cc2ce68e68c14e 100644 (file)
@@ -669,8 +669,7 @@ var AllView = GObject.registerClass({
                 this._canScroll = true;
                 this._scrollTimeoutId = 0;
                 return GLib.SOURCE_REMOVE;
-            }
-        );
+            });
 
         return Clutter.EVENT_STOP;
     }
@@ -1323,8 +1322,7 @@ var AppSearchProvider = class AppSearchProvider {
                 return app && this._parentalControlsManager.shouldShowApp(app.app_info);
             });
             results = results.concat(group.sort(
-                (a, b) => usage.compare(a, b)
-            ));
+                (a, b) => usage.compare(a, b)));
         });
 
         results = results.concat(this._systemActions.getMatchingActions(terms));
@@ -2498,14 +2496,12 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
         this.removeAll();
 
         let windows = this._source.app.get_windows().filter(
-            w => !w.skip_taskbar
-        );
+            w => !w.skip_taskbar);
 
         if (windows.length > 0) {
             this.addMenuItem(
                 /* Translators: This is the heading of a list of open windows */
-                new PopupMenu.PopupSeparatorMenuItem(_("Open Windows"))
-            );
+                new PopupMenu.PopupSeparatorMenuItem(_('Open Windows')));
         }
 
         windows.forEach(window => {
index 15727f4f37c445975ccdf9d66c5104c8e49fc598..1e9cb11fec39de50166a1aa3562bf052ade327f6 100644 (file)
@@ -147,9 +147,8 @@ var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
     _onDeviceSelected(dialog, device) {
         let connection = this._dbusImpl.get_connection();
         let info = this._dbusImpl.get_info();
-        let deviceName = Object.keys(AudioDevice).filter(
-            dev => AudioDevice[dev] == device
-        )[0].toLowerCase();
+        const deviceName = Object.keys(AudioDevice)
+            .filter(dev => AudioDevice[dev] === device)[0].toLowerCase();
         connection.emit_signal(this._audioSelectionDialog._sender,
                                this._dbusImpl.get_object_path(),
                                info ? info.name : null,
index 2813e51afc0df9bf26a43e1095546c8bacae3e3c..74300136b7b1919eaad25c7b8e8316a3b18be30e 100644 (file)
@@ -13,17 +13,13 @@ var ComponentManager = class {
     _sessionUpdated() {
         let newEnabledComponents = Main.sessionMode.components;
 
-        newEnabledComponents.filter(
-            name => !this._enabledComponents.includes(name)
-        ).forEach(name => {
-            this._enableComponent(name);
-        });
-
-        this._enabledComponents.filter(
-            name => !newEnabledComponents.includes(name)
-        ).forEach(name => {
-            this._disableComponent(name);
-        });
+        newEnabledComponents
+            .filter(name => !this._enabledComponents.includes(name))
+            .forEach(name => this._enableComponent(name));
+
+        this._enabledComponents
+            .filter(name => !newEnabledComponents.includes(name))
+            .forEach(name => this._disableComponent(name));
 
         this._enabledComponents = newEnabledComponents;
     }
index cfa42834baebded01b42b578d4b9bf52646e7429..cc7b41274fbf126dd940041e4688f09755772e03 100644 (file)
@@ -125,8 +125,7 @@ var ContentTypeDiscoverer = class {
     _emitCallback(mount, contentTypes = []) {
         // we're not interested in win32 software content types here
         contentTypes = contentTypes.filter(
-            type => type != 'x-content/win32-software'
-        );
+            type => type !== 'x-content/win32-software');
 
         let apps = [];
         contentTypes.forEach(type => {
index 4cce0c52dea94dd9f201103134251f0ace8024f3..1a34f19e9e384b1d352207ea78eba9e7e1f80ba3 100644 (file)
@@ -463,19 +463,15 @@ var ExtensionManager = class {
 
         // Find and enable all the newly enabled extensions: UUIDs found in the
         // new setting, but not in the old one.
-        newEnabledExtensions.filter(
-            uuid => !this._enabledExtensions.includes(uuid)
-        ).forEach(uuid => {
-            this._callExtensionEnable(uuid);
-        });
+        newEnabledExtensions
+            .filter(uuid => !this._enabledExtensions.includes(uuid))
+            .forEach(uuid => this._callExtensionEnable(uuid));
 
         // Find and disable all the newly disabled extensions: UUIDs found in the
         // old setting, but not in the new one.
-        this._extensionOrder.filter(
-            uuid => !newEnabledExtensions.includes(uuid)
-        ).reverse().forEach(uuid => {
-            this._callExtensionDisable(uuid);
-        });
+        this._extensionOrder
+            .filter(uuid => !newEnabledExtensions.includes(uuid))
+            .reverse().forEach(uuid => this._callExtensionDisable(uuid));
 
         this._enabledExtensions = newEnabledExtensions;
     }
index d26fabc9f96040b386561f17de5a485daa3239c5..7ce8668023ec147397f811b4c385fb4045bc58b4 100644 (file)
@@ -935,8 +935,7 @@ var EmojiSelection = GObject.registerClass({
         this.add_child(this._emojiPager);
 
         this._pageIndicator = new PageIndicators.PageIndicators(
-            Clutter.Orientation.HORIZONTAL
-        );
+            Clutter.Orientation.HORIZONTAL);
         this.add_child(this._pageIndicator);
         this._pageIndicator.setReactive(false);
 
index 4f265af42bea9ec96450009e53bab8eda2066614..9aaef1aeb79d2e59828f52707f6d9739ee46ea46 100644 (file)
@@ -27,13 +27,11 @@ var RadialShaderEffect = GObject.registerClass({
         'brightness': GObject.ParamSpec.float(
             'brightness', 'brightness', 'brightness',
             GObject.ParamFlags.READWRITE,
-            0, 1, 1
-        ),
+            0, 1, 1),
         'sharpness': GObject.ParamSpec.float(
             'sharpness', 'sharpness', 'sharpness',
             GObject.ParamFlags.READWRITE,
-            0, 1, 0
-        ),
+            0, 1, 0),
     },
 }, class RadialShaderEffect extends Shell.GLSLEffect {
     _init(params) {
index 6ef8ddae38cfdee16701cd2dd3236a569c63a79e..ba8872891a05908a26a33389d7aa8df943aaa824 100644 (file)
@@ -39,8 +39,7 @@ function _getAutoCompleteGlobalKeywords() {
     const keywords = ['true', 'false', 'null', 'new'];
     // Don't add the private properties of globalThis (i.e., ones starting with '_')
     const windowProperties = Object.getOwnPropertyNames(globalThis).filter(
-        a => a.charAt(0) != '_'
-    );
+        a => a.charAt(0) !== '_');
     const headerProperties = JsParse.getDeclaredConstants(commandHeader);
 
     return keywords.concat(windowProperties).concat(headerProperties);
index 1c935b9c93052c497af9bb3a211ecf7896853c51..692cb102224d38a963ff1418390aee7330aca40d 100644 (file)
@@ -643,8 +643,7 @@ var Magnifier = class Magnifier {
         // Applies only to the first zoom region.
         if (this._zoomRegions.length) {
             this._zoomRegions[0].setClampScrollingAtEdges(
-                !this._settings.get_boolean(CLAMP_MODE_KEY)
-            );
+                !this._settings.get_boolean(CLAMP_MODE_KEY));
         }
     }
 
@@ -652,8 +651,7 @@ var Magnifier = class Magnifier {
         // Applies only to the first zoom region.
         if (this._zoomRegions.length) {
             this._zoomRegions[0].setMouseTrackingMode(
-                this._settings.get_enum(MOUSE_TRACKING_KEY)
-            );
+                this._settings.get_enum(MOUSE_TRACKING_KEY));
         }
     }
 
@@ -661,8 +659,7 @@ var Magnifier = class Magnifier {
         // Applies only to the first zoom region.
         if (this._zoomRegions.length) {
             this._zoomRegions[0].setFocusTrackingMode(
-                this._settings.get_enum(FOCUS_TRACKING_KEY)
-            );
+                this._settings.get_enum(FOCUS_TRACKING_KEY));
         }
     }
 
@@ -670,8 +667,7 @@ var Magnifier = class Magnifier {
         // Applies only to the first zoom region.
         if (this._zoomRegions.length) {
             this._zoomRegions[0].setCaretTrackingMode(
-                this._settings.get_enum(CARET_TRACKING_KEY)
-            );
+                this._settings.get_enum(CARET_TRACKING_KEY));
         }
     }
 
@@ -679,8 +675,7 @@ var Magnifier = class Magnifier {
         // Applies only to the first zoom region.
         if (this._zoomRegions.length) {
             this._zoomRegions[0].setInvertLightness(
-                this._settings.get_boolean(INVERT_LIGHTNESS_KEY)
-            );
+                this._settings.get_boolean(INVERT_LIGHTNESS_KEY));
         }
     }
 
@@ -688,8 +683,7 @@ var Magnifier = class Magnifier {
         // Applies only to the first zoom region.
         if (this._zoomRegions.length) {
             this._zoomRegions[0].setColorSaturation(
-                this._settings.get_double(COLOR_SATURATION_KEY)
-            );
+                this._settings.get_double(COLOR_SATURATION_KEY));
         }
     }
 
@@ -1941,9 +1935,8 @@ var MagShaderEffects = class MagShaderEffects {
         // it modifies the brightness and/or contrast.
         let [cRed, cGreen, cBlue] = this._brightnessContrast.get_contrast();
         this._brightnessContrast.set_enabled(
-            bRed != NO_CHANGE || bGreen != NO_CHANGE || bBlue != NO_CHANGE ||
-             cRed != NO_CHANGE || cGreen != NO_CHANGE || cBlue != NO_CHANGE
-        );
+            bRed !== NO_CHANGE || bGreen !== NO_CHANGE || bBlue !== NO_CHANGE ||
+            cRed !== NO_CHANGE || cGreen !== NO_CHANGE || cBlue !== NO_CHANGE);
     }
 
     /**
@@ -1970,8 +1963,7 @@ var MagShaderEffects = class MagShaderEffects {
         // a null first argument.
         let [bRed, bGreen, bBlue] = this._brightnessContrast.get_brightness();
         this._brightnessContrast.set_enabled(
-            cRed != NO_CHANGE || cGreen != NO_CHANGE || cBlue != NO_CHANGE ||
-            bRed != NO_CHANGE || bGreen != NO_CHANGE || bBlue != NO_CHANGE
-        );
+            cRed !== NO_CHANGE || cGreen !== NO_CHANGE || cBlue !== NO_CHANGE ||
+            bRed !== NO_CHANGE || bGreen !== NO_CHANGE || bBlue !== NO_CHANGE);
     }
 };
index f4ceb0ae799230ba9ee2738c1ea8a34f20cbbb58..dc5ed9ce161b721e8fbfb841f810f9eb64f10e11 100644 (file)
@@ -1160,8 +1160,7 @@ var MessageTray = GObject.registerClass({
                                      this._onNotificationDestroy.bind(this));
                 this._notificationQueue.push(notification);
                 this._notificationQueue.sort(
-                    (n1, n2) => n2.urgency - n1.urgency
-                );
+                    (n1, n2) => n2.urgency - n1.urgency);
                 this.emit('queue-changed');
             }
         }
index 2e6b93da691006d58c6d7102a41849b3c97d9e9c..39ca92c24eef8a9f5502d325cbcf5f66e4fbba4c 100644 (file)
@@ -400,8 +400,7 @@ var Overview = class {
 
     _getDesktopClone() {
         let windows = global.get_window_actors().filter(
-            w => w.meta_window.get_window_type() == Meta.WindowType.DESKTOP
-        );
+            w => w.meta_window.get_window_type() === Meta.WindowType.DESKTOP);
         if (windows.length == 0)
             return null;
 
index e4f20daa634bf44f269ba34eb9dce4c9ef284421..1c6e3f368e2f50249a41530ea569557169f4d0d9 100644 (file)
@@ -1153,10 +1153,9 @@ class Panel extends St.Widget {
 
     _getDraggableWindowForPosition(stageX) {
         let workspaceManager = global.workspace_manager;
-        let workspace = workspaceManager.get_active_workspace();
-        let allWindowsByStacking = global.display.sort_windows_by_stacking(
-            workspace.list_windows()
-        ).reverse();
+        const windows = workspaceManager.get_active_workspace().list_windows();
+        const allWindowsByStacking =
+            global.display.sort_windows_by_stacking(windows).reverse();
 
         return allWindowsByStacking.find(metaWindow => {
             let rect = metaWindow.get_frame_rect();
index f9125123e6599f6d8e4c6602851e4f3cf317b25d..1c91995380c1ea64dd1f4cdb1dca6e72eb29668c 100644 (file)
@@ -220,8 +220,7 @@ var SearchResultsBase = GObject.registerClass({
 
     _ensureResultActors(results, callback) {
         let metasNeeded = results.filter(
-            resultId => this._resultDisplays[resultId] === undefined
-        );
+            resultId => this._resultDisplays[resultId] === undefined);
 
         if (metasNeeded.length === 0) {
             callback(true);
index dc620a09d10b75795484c28206e6eead8ce1c112..2956c0e967e91304380e1b8090506ce4c97138bc 100644 (file)
@@ -295,8 +295,8 @@ var ShellMountPasswordDialog = GObject.registerClass({
             this._keyfilesLabel = new St.Label({ visible: false });
             this._keyfilesLabel.clutter_text.set_markup(
                 /* Translators: %s is the Disks application */
-                _("To unlock a volume that uses keyfiles, use the <i>%s</i> utility instead.").format(disksApp.get_name())
-            );
+                _('To unlock a volume that uses keyfiles, use the <i>%s</i> utility instead.')
+               .format(disksApp.get_name()));
             this._keyfilesLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
             this._keyfilesLabel.clutter_text.line_wrap = true;
             content.add_child(this._keyfilesLabel);
@@ -464,8 +464,7 @@ var ShellMountPasswordDialog = GObject.registerClass({
                 /* Translators: %s is the Disks application */
                 _("Unable to start %s").format(app.get_name()),
                 /* Translators: %s is the Disks application */
-                _("Couldn’t find the %s application").format(app.get_name())
-            );
+                _('Couldn’t find the %s application').format(app.get_name()));
         }
         this._onCancelButton();
     }
index 5bd81f1870f110ae26d8e48bae81b065513a155a..642e1a104d8a79fe58d7e47824b73442762e730e 100644 (file)
@@ -716,8 +716,7 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
 
         let connections = client.get_connections();
         this._connections = connections.filter(
-            connection => device.connection_valid(connection)
-        );
+            connection => device.connection_valid(connection));
 
         this._apAddedId = device.connect('access-point-added', this._accessPointAdded.bind(this));
         this._apRemovedId = device.connect('access-point-removed', this._accessPointRemoved.bind(this));
@@ -1863,8 +1862,7 @@ class Indicator extends PanelMenu.SystemIndicator {
     _syncVpnConnections() {
         let activeConnections = this._client.get_active_connections() || [];
         let vpnConnections = activeConnections.filter(
-            a => a instanceof NM.VpnConnection
-        );
+            a => a instanceof NM.VpnConnection);
         vpnConnections.forEach(a => {
             ensureActiveConnectionProps(a);
         });
index 279ebcf0cf29e4524ad54badeee43af10013e426..e64b62cf4ef27165117a7ff1eabb97e467a36f86 100644 (file)
@@ -82,8 +82,7 @@ class Indicator extends PanelMenu.SystemIndicator {
         });
 
         let app = this._settingsApp = Shell.AppSystem.get_default().lookup_app(
-            'gnome-control-center.desktop'
-        );
+            'gnome-control-center.desktop');
         if (app) {
             let [icon, name] = [app.app_info.get_icon().names[0],
                                 app.get_name()];
index 52ea5fdbf51865b22cbc6a42c1f0f55321f153d2..942b874498e733d84ca90a5994182e5fa88668de 100644 (file)
@@ -819,8 +819,7 @@ class WorkspacesDisplay extends St.Widget {
                 this._canScroll = true;
                 this._scrollTimeoutId = 0;
                 return GLib.SOURCE_REMOVE;
-            }
-        );
+            });
 
         return Clutter.EVENT_STOP;
     }